<template>
	<u-modal :show="showBox"   :closeOnClickOverlay="true" :showCancelButton="true"   @confirm="confirmBox"   @cancel="()=>{this.showBox=false}">
		<view class="slot-content">
			<view class="form_box" >
				
				<uni-forms ref="form" :rules="rules" >
				
						
					<uni-forms-item v-if="areaList.length>0&&optData.pro_type==1"  label="生产地" name="product_area">
						<view class="form_item_input">
							<picker @change="selectChange" data-key="product_area" :value="areaIndex" :range="areaList" :range-key="'name'">
								<view style="padding-left: 20rpx;line-height: 60rpx;" class="uni-input">{{areaList[areaIndex].val}}</view>
							</picker>
						</view>
					</uni-forms-item>
					
					
					<uni-forms-item v-if="optData.pro_type==2&&optData.cerp_sync_can==1"  label="同步方式" name="cerp_sync">
						<view class="form_item_input">
							<picker @change="selectChange" data-key="cerp_sync" :value="syncIndex" :range="syncList" :range-key="'name'">
								<view style="padding-left: 20rpx;line-height: 60rpx;" class="uni-input">{{syncList[syncIndex].name}}</view>
							</picker>
						</view>
					</uni-forms-item>
					
					<uni-forms-item  v-if="showAddress"  label="收货地址" name="mark">
						<view class="form_item_input" style="padding-left: 20rpx; width: 90%;">
							<pick-regions :defaultRegion="defaultRegionCode" @getRegion="handleGetRegion">
								<view class="item_value_info" v-if="regionName">{{regionName}}</view>
								<view class="item_value_info" v-else>所在城市</view>
							</pick-regions>
						</view>
					</uni-forms-item>
					
					<uni-forms-item   v-if="showAddress"   label="详细地址" name="mark">
						<uni-easyinput type="text"  v-model="address.address" maxlength="250" placeholder="请输入收货地址"></uni-easyinput>
					</uni-forms-item>
					
					<uni-forms-item   v-if="showAddress"   label="收件人" name="mark">
						<uni-easyinput type="text"  v-model="address.receiver_name" maxlength="250" placeholder="请输入收件人"></uni-easyinput>
					</uni-forms-item>
					
					<uni-forms-item v-if="showAddress"   label="手机号" name="tel">
						<uni-easyinput type="text" v-model="address.tel" maxlength="140" placeholder="请输入手机号"></uni-easyinput>
					</uni-forms-item>
					
					
					<uni-forms-item v-if="showAddress"   label="订单备注" name="mark">
						<uni-easyinput type="text"  v-model="formData.mark" maxlength="140" placeholder="请输入订单备注"></uni-easyinput>
					</uni-forms-item>
					
					
					
					<uni-forms-item v-if="!showAddress"   label="订单备注" name="mark">
						<uni-easyinput type="textarea" autoHeight v-model="formData.mark" maxlength="140" placeholder="请输入订单备注"></uni-easyinput>
					</uni-forms-item>
					
					
					<u-modal title="付款方式"  content="请选择付款方式" :show="showConfirm" showCancelButton closeOnClickOverlay @confirm="confirmCode" @cancel="()=>{this.showConfirm=false}"  >
						<view class="slot-content">
							<view class="form_box" >
								<uni-forms-item  label="货到付款" name="cash_on_deliver">
									<uni-data-checkbox selectedColor="#910a15" v-model="formData.cash_on_deliver" :localdata="payWay" />
								</uni-forms-item>
							</view>
						</view>
					</u-modal>
					
				</uni-forms>
				
			</view>
		</view>
	</u-modal>
</template>

<script>
	import {index} from './order-info.js';
	export default {name: 'orderInfo',mixins: [index]}
</script>
<style>
	@import 'order-info.css';
</style>
